package com.yuwei.user.viewmodel

import androidx.lifecycle.viewModelScope
import com.yuwei.common.mvi.BaseViewModel
import com.yuwei.user.api.UserApiService
import com.yuwei.user.intent.UserIntent
import kotlinx.coroutines.launch

class UserViewModel :BaseViewModel<UserApiService,UserIntent>(){
    override fun handleIntent(intent: UserIntent) {
        viewModelScope.launch {
            when(intent){
                is UserIntent.getUserLogin->{
                    httpRequest(apiService.getUserLogin(intent.password,intent.username),"getUserLogin")
                }
            }
        }
    }
}